//
//  ZDMyClassViewcontroller.m
//  ZHIDOU
//
//  Created by 向礼 on 2018/12/25.
//  Copyright © 2018 向礼. All rights reserved.
//

#import "ZDMyClassViewcontroller.h"
#import "MyClassCell.h"

@interface ZDMyClassViewcontroller ()<UITableViewDataSource ,UITableViewDelegate>
@property (nonatomic ,strong)UITableView *tableView ;

@end

@implementation ZDMyClassViewcontroller
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:animated];
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
   // self.title = @"我的课程";
    [self setUpViews];
    // Do any additional setup after loading the view.
}


-(void)setVCType:(viewControllerType)VCType{
     _VCType = VCType;
    switch (_VCType) {
        case MyClass:
            self.title = @"我的课程";
            break;
        case MyDownload:
            self.title = @"我的下载";
            break;
    }
}

#pragma mark - UI
- (void)setUpViews {
    self.tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, ZD_screenWidth, ZD_screenHeight) style:UITableViewStylePlain];
    self.tableView.separatorStyle = UITableViewCellEditingStyleNone;
    self.tableView.backgroundColor = ZD_backgroundColor;
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    [self.tableView registerNib:[UINib nibWithNibName:@"MyClassCell" bundle:nil] forCellReuseIdentifier:@"MyClassCell"];
    [self.view addSubview:self.tableView];
}


#pragma mark -  TableViewDelegete
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 3;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    MyClassCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyClassCell" forIndexPath:indexPath];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 114;
}

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 15;
}

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    return nil;
}


@end
